# coding=utf-8
from django.contrib import admin
from django.conf import settings
from apps.joinus.models import JobType, Job

class JobTypeAdmin(admin.ModelAdmin):
    list_display = ('type_rank', 'type_name_en', 'type_name_zh', 'type_tag')
    list_filter = ('type_rank', )
    list_max_show_all = 100
    list_per_page = 10
    search_fields = ['type_name_en', 'type_name_zh']

    class Media:
        js = [settings.MEDIA_URL+'plugins/tiny_mce/tiny_mce_src.js', 
              #settings.MEDIA_URL+'plugins/tiny_mce/tiny_mce_config.js',
              settings.MEDIA_URL+'plugins/filebrowser/js/TinyMCEAdmin.js'
             ]

class JobAdmin(admin.ModelAdmin):
    list_display = ('job_type', 'job_title_en', 'job_title_zh', 'job_position', 'job_tag', 'job_rank')
    list_filter = ('job_rank', 'job_position')
    list_max_show_all = 100
    list_per_page = 10
    search_fields = ['type_name_en', 'type_name_zh']
    class Media:
        js = [settings.MEDIA_URL+'plugins/tiny_mce/tiny_mce_src.js', 
              #settings.MEDIA_URL+'plugins/tiny_mce/tiny_mce_config.js',
              settings.MEDIA_URL+'plugins/filebrowser/js/TinyMCEAdmin.js'
             ]

admin.site.register(JobType, JobTypeAdmin)
admin.site.register(Job, JobAdmin)
